<?php
$id_pegawai=$_POST['id_pegawai'];
$nama=$_POST['nama'];
$username=$_POST['username'];
$pwd=$_POST['password'];
$password=sha1($pwd);
$level=$_POST['level'];
$sql=dbQuery("select * from tbpegawai where username='$username'");
$baris=dbRows($sql);
	if($baris!==0){
		echo"<script>alert('Maaf Username Yang anda Masukkan sudah terpakai')</script>";
		echo"<meta http-equiv='refresh' content='0;url=index_admin.php?index=input_pegawai&cryption=$random.*upn*.$santra.$random' /";
	}else{
	
	
	$insert=dbQuery("insert into tbpegawai(id_pegawai,nama_pegawai,username,password,level) values('$id_pegawai','$nama','$username','$password','$level')")or die(mysql_error());
		if($insert){
	?>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3" class="judul">&#187 Konfirmasi Input Data Pegawai</td></tr>
	<tr><td colspan="3" class="jarak_garis"><hr color="#6d6a69"></hr></td></tr>
	<tr><td colspan="3" class="suskes" align="center">Selamat Anda Sukses inputkan data Pegawai</td></tr>
	<tr><td colspan="3"><div id="pagging" align="center"><a href="index_admin.php?index=manage_pegawai&cryption=<?php print $random."upn".$santra.$encode?>">[Kembali]</a></div></td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
<?php }else{
?>
<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3" class="judul">&#187 Konfirmasi Input Data Pegawai</td></tr>
	<tr><td colspan="3" class="jarak_garis"><hr color="#6d6a69"></hr></td></tr>
	<tr><td colspan="3" class="suskes" align="center">Maaf Anda Gagal inputkan Data,coba ulangi verifikasi data yang anda inputkan</td></tr>
	<tr><td colspan="3"><div id="pagging" align="center"><a href="index_admin.php?index=input_pegawai&cryption=<?php print $random."upn".$santra.$encode?>">[Kembali]</a></td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
	<tr><td colspan="3">&nbsp;</td></tr>
<?php }

}


?>
